//
//  ViewController.m
//  NetTest
//
//  Created by xujijun on 15/12/25.
//  Copyright © 2015年 xujijun. All rights reserved.
//

#import "ViewController.h"
#import "YKXYMAcountManger.h"
#import "YKXYMAcountDataReformer.h"

@interface ViewController ()
{
    
}
@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.
    
    YKXYMAcountManger *manger=[[YKXYMAcountManger alloc] init];
    manger.delegate=self;
    manger.paramsDelegate=self;
    [manger startRequest];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

-(void)managerCallAPIDidFailed:(YKAPIManager *)manager
{
    
}

-(void)managerCallAPIDidSuccessed:(YKAPIManager *)manager
{
    NSDictionary *data=(NSDictionary *)[manager fetchDataWithReformer:[[YKXYMAcountDataReformer alloc] init]];
    
    NSString *str=data[UserIdKey];
    NSLog(@"%@",str);
    
    NSLog(@"%@",data);
}

-(NSDictionary *)paramsForManager:(YKAPIManager *)manager
{
    NSMutableDictionary *dic=(NSMutableDictionary *)[[NSDictionary alloc] initWithObjectsAndKeys:@"11",@"id", @"222",@"name",nil];
    return dic;
}

-(NSDictionary *)headersForManager:(YKAPIManager *)manager
{
    return nil;
}

@end
